package com.amumu.drama.common.constant;

import com.google.common.collect.Maps;
import lombok.Getter;

import java.util.Arrays;
import java.util.Map;

/**
 * @author sunzhuang
 * @date 2024/5/14 13:56
 * @slogan 天下风云出我辈, 一入代码岁月催
 * @desc 发货供应商类型
 */
@Getter
public enum DeliveryProviderEnum {
    /**
     * 支付状态
     */
    FULU("FULU", "福禄"),
    MANUAL("MANUAL", "人工"),
    TAOBAO("TAOBAO", "淘宝"),
    ;

    private String code;

    private String desc;

    DeliveryProviderEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    private static final Map<String, DeliveryProviderEnum> UNINDEX = Maps.uniqueIndex(Arrays.asList(values()), DeliveryProviderEnum::getCode);

    public static DeliveryProviderEnum getByCode(String code) {
        return UNINDEX.get(code);
    }

}
